{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = 'all'  # default is ‘last_expr’\n",
    "\n",
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('/data/home/marmot/camtrap/PyCharm/CameraTraps-benchmark')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import json\n",
    "import os\n",
    "from collections import OrderedDict, defaultdict, Counter\n",
    "from copy import deepcopy\n",
    "from random import sample\n",
    "from statistics import mean, median\n",
    "import math\n",
    "\n",
    "from PIL import Image\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import matplotlib.ticker as mtick\n",
    "from tqdm import tqdm\n",
    "\n",
    "from data_management.cct_json_utils import CameraTrapJsonUtils, IndexedJsonDb\n",
    "from visualization.visualization_utils import plot_stacked_bar_chart, render_db_bounding_boxes, resize_image"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Size of bounding boxes\n",
    "\n",
    "As a percentage of image size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_images_annotations(file_template):\n",
    "    # combine train and val splits for the image databases\n",
    "    all_images = []\n",
    "    all_annotations = []\n",
    "\n",
    "    for i in ('train', 'val'):\n",
    "        with open(file_template.format(i)) as f:\n",
    "            db = json.load(f)\n",
    "        print('{} has {} images, {} annotations'.format(i, len(db['images']), len(db['annotations'])))\n",
    "        all_images.extend(db['images'])\n",
    "        all_annotations.extend(db['annotations'])\n",
    "\n",
    "    print('In total there are {} images, {} annotations'.format(len(all_images), len(all_annotations)))\n",
    "    \n",
    "    db_indexed = IndexedJsonDb(db)  # assume both train and val have the same categories field\n",
    "    \n",
    "    return all_images, all_annotations, db_indexed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_box_size_proportion(all_images, all_annotations):\n",
    "    image_to_size = {}\n",
    "    for i in all_images:\n",
    "        image_to_size[i['id']] = i['width'] * i['height']\n",
    "\n",
    "    ave_size = mean(image_to_size.values())\n",
    "    print('Average image size is {}. Square root of that is {}'.format(ave_size, math.sqrt(ave_size)))\n",
    "\n",
    "    box_size_percent = []  # size of each box as a percentage of its image\n",
    "    box_width_to_height = []\n",
    "    for a in all_annotations:\n",
    "        _, _, w, h = a['bbox']\n",
    "        image_size = image_to_size[a['image_id']]\n",
    "        percent = w * h / image_size\n",
    "        box_size_percent.append(percent)\n",
    "        \n",
    "        box_width_to_height.append(w/h)\n",
    "    return box_size_percent, box_width_to_height"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def print_stats(array):\n",
    "    print('\\nmean', mean(array))\n",
    "    print('median', median(array))\n",
    "    print('min', min(array))\n",
    "    print('max', max(array))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train has 26460 images, 27644 annotations\n",
      "val has 19566 images, 20459 annotations\n",
      "In total there are 46026 images, 48103 annotations\n"
     ]
    }
   ],
   "source": [
    "cct_file_template = '/beaver_disk/camtrap/caltech/benchmark/cct-20/caltech-20_bboxes_20190904_{}.json'\n",
    "cct_images, cct_annotations, cct_db_indexed = get_images_annotations(cct_file_template)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average image size is 3119978.357971581. Square root of that is 1766.346047062008\n",
      "\n",
      "mean 0.09858267356575082\n",
      "median 0.02673092369477912\n",
      "min 0.000381242571257343\n",
      "max 1.0\n",
      "\n",
      "mean 1.3002100231726141\n",
      "median 1.2786512459658506\n",
      "min 0.14572864321608067\n",
      "max 13.040000000000001\n"
     ]
    }
   ],
   "source": [
    "cct_box_size_percent, cct_box_width_to_height = get_box_size_proportion(cct_images, cct_annotations)\n",
    "\n",
    "print_stats(cct_box_size_percent)\n",
    "print_stats(cct_box_width_to_height)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train has 9244 images, 14949 annotations\n",
      "val has 3133 images, 4438 annotations\n",
      "In total there are 12377 images, 19387 annotations\n"
     ]
    }
   ],
   "source": [
    "ss1_file_template = '/beaver_disk/camtrap/ss_season1/benchmark/SnapshotSerengetiBboxesS01_20190903_{}.json'\n",
    "ss1_images, ss1_annotations, ss1_db_indexed = get_images_annotations(ss1_file_template)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Average image size is 3145728. Square root of that is 1773.6200269505302\n",
      "\n",
      "mean 0.11397804474177163\n",
      "median 0.03146632559195927\n",
      "min 2.454770669994595e-05\n",
      "max 0.9964217685390699\n",
      "\n",
      "mean 1.397919769380166\n",
      "median 1.2027269226826325\n",
      "min 0.05100574915699493\n",
      "max 14.026646204652389\n"
     ]
    }
   ],
   "source": [
    "ss1_box_size_percent, ss1_box_width_to_height = get_box_size_proportion(ss1_images, ss1_annotations)\n",
    "\n",
    "print_stats(ss1_box_size_percent)\n",
    "print_stats(ss1_box_width_to_height)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Plots"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_side_by_side_hist(series, names, num_bins=20, num_x_ticks=6, y_logscale=False):\n",
    "    # each series is normalized by the number of items in each series\n",
    "    totals = []\n",
    "    for s in series:\n",
    "        totals.append(len(s))\n",
    "    \n",
    "    weights = []\n",
    "    for t in totals:\n",
    "        series_weights = [1/t] * t  # t weights, each has value 1/t\n",
    "        weights.append(series_weights)\n",
    "    \n",
    "    fig = plt.figure()\n",
    "    ax = plt.subplot(111)\n",
    "\n",
    "    n, bins, patches = ax.hist(series,\n",
    "                             bins=num_bins,\n",
    "                             weights=weights,\n",
    "                             label=names)\n",
    "\n",
    "    ax.legend()\n",
    "    ax.set_xlabel('Percent of image size')\n",
    "    ax.set_ylabel('Percent of instances')\n",
    "\n",
    "    # https://stackoverflow.com/questions/31357611/format-y-axis-as-percent\n",
    "    ax.xaxis.set_major_formatter(mtick.PercentFormatter(1.0))  \n",
    "    ax.yaxis.set_major_formatter(mtick.PercentFormatter(1.0))  \n",
    "    \n",
    "    # https://stackoverflow.com/questions/6682784/reducing-number-of-plot-ticks\n",
    "    ax.xaxis.set_major_locator(plt.MaxNLocator(num_x_ticks))\n",
    "    \n",
    "    if y_logscale:\n",
    "        ax.set_yscale('log')\n",
    "    return fig"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of CCT boxes: 48103\n",
      "Number of SS1 boxes: 19387\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XucFNWZ//HPV8ABDAjC6IpEwRuJCoKMBKJuiHhN4j0xJmqIl6CbxJWYeNuNv8iqiyZekERXUTRoMEQ0iUqISlhUslG56CgoRNS4OkIEXVGIiiDP7486QDvOTDfMdE/PzPf9evWrq06fqn6qe2aeqTqnzlFEYGZm1pCtmjsAMzMrf04WZmaWl5O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XXUVzz77LP3792fMmDEb33fdunXMmTOHcePGfay8lEqRLL7BpktQAPeTJQPS83216l8AXB8Ra4FOQJC1Z3zizMLMbHN86lOfYv78+UyYMIHKykq+/vWv88tf/hKAW2+9lZkzZzJkyBCuvvpqTj/99E9sf8ABB3Deeecxfvx4Vq5cSfv27Xn44Yd5+OGHGTRoEPvttx+LFy9myZKsqXX8+PHsu+++DB06lNdee40lS5aw66678vLLL3POOefw4IMP0rVrV9555x1WrlzJF77wBQBGjhy5MeEAHH/88QAMHjy42S6PFTVZpLOEQ4Hf5hRfCRwqaUl67cqc+r2AqojYkECuAZ4gSyp3FTNWM2sb2rVrx/DhwxkzZgy/+MUvuPfeeze+1r9/f37wgx8wY8aMj5VvcNFFF3Hrrbfy/vvvM3ToUBYvXkxEcPHFF1NdXU11dTUvvvgiZ5xxBo888gh/+tOfePzxx3nmmWcYNGgQH3zwAd27d+eZZ55h+PDh3HDDDZx55pl5Y95w2axdu3asW7eu6T6MzVDUZBER70VEj4h4J6fsrYgYERF7pOf/y3ltaUR8JWd9akTsHREHRIQbJcysUf76179u/K8fsnaCXXbZhdWrV/PII498ory2l156if79+3PhhRdSVVXF4sWLOfzww7nttttYvXo1kM2Mt3z5ct555x26d+9O586dWbx4MU888QQAb775JuvXr+eEE07gsssu46mnnmLbbbele/fuG9sj7rzzzo1nGeXCQ5SbWfMpoKtrU1q9ejXnnHPOxktIu+++OxMmTCAi+OlPf8pZZ51Fp06d2GabbTZenso1btw4Zs2aRbt27dhrr7048sgjqaioYNGiRQwbNgzILnX96le/4ogjjuCmm25iwIAB9OvXj6FDhwJZMjnttNM2tomMHTsWyCZOOvvss3nvvffYdddduf322zfr2A466CAWL17M6tWr6d27NxMnTuTwww9vxKf1cR6iHA9RblYqHqK8eXmIcjMzKyonCzMzy8vJwsxKqrVc+m5pGvu5O1mYWcl07NiRt956ywmjxCKCt956i44dO27xPtwbysxKpnfv3tTU1ODheUqvY8eO9O7de4u3d7Iws5Lp0KEDffv2be4wbA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Wl5OFmZnl9f8B/WZ7Sj1P8VwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "cct_num_boxes = len(cct_box_size_percent)\n",
    "ss1_num_boxes = len(ss1_box_size_percent)\n",
    "print('Number of CCT boxes:', cct_num_boxes)\n",
    "print('Number of SS1 boxes:', ss1_num_boxes)\n",
    "\n",
    "names = ['CCT-20', 'SS season 1']\n",
    "series = [cct_box_size_percent, ss1_box_size_percent]\n",
    "\n",
    "fig = plot_side_by_side_hist(series, names, y_logscale=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig.savefig('/home/marmot/camtrap/mnt/intermediate/dataset_paper/bbox_dist.svg', \n",
    "            format='svg', bbox_inches='tight')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Zoom in to the smallest boxes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "42157"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "13837"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "percent_threshold = 0.1\n",
    "\n",
    "cct_small = []\n",
    "ss1_small = []\n",
    "\n",
    "for c in cct_box_size_percent:\n",
    "    if c < percent_threshold:\n",
    "        cct_small.append(c)\n",
    "\n",
    "for s in ss1_box_size_percent:\n",
    "    if s < percent_threshold:\n",
    "        ss1_small.append(s)\n",
    "\n",
    "len(cct_small)\n",
    "len(ss1_small)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAELCAYAAAARNxsIAAAABHNCSVQICAgIfAhki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02aLzndQMbNGpbKykg4dOtC9e3eSrlerLxHBhx9+SGVlJT169Niia3juLzNrVD799FN22mknB5QGIImddtppq1qJDipm1ug4oDScrf3uHVTMzHL45z//ySmnnMJee+1Fnz59GDFiBK+//jqvv/46I0aMoGfPnuy7776cdNJJPPTQQwwYMIABAwaw/fbb07t3bwYMGMDpp5++yXUvueQS9tlnH/r168cJJ5zA8uXLq49dc8019OzZk969ezN16tRNzm0K3KdiZo1a9zF/LOj13r72q3XmiQhOOOEERo0axYMPPghARUUF7777LmeeeSY33XQTxx57LADTp0+nS5cuVFRUADB06FBuuOEGyspyD5Q68sgjueaaa2jdujWXXnop11xzDddddx2vvvoqDz74IK+88grvvPMORxxxBK+//jqtWrUqUM3rh4NKIYztWEP6ivoth5kVxPTp02nTpg3nnrtxrtoBAwYwYcIEhgwZUh1QAA499NDNuvawYcOqtwcPHsyjjyYTtj/xxBOccsoplJSU0KNHD3r27MnMmTMZMmTIVtamfvn2l5lZlvnz53PggQfmnb6lJkyYwNFHHw3A0qVL2W233aqPlZaWsnTp0oJ9Vn1xUDEzawBXX301rVu35pvf/CaQ3HLL1hQHLDiomJll6du3L+Xl5Xmn1+aMM85gwIABjBgxojpt4sSJTJkyhUmTJlUHjtLSUpYs2bjiR2VlJV27dt3CGjQcBxUzsyyHHXYYa9as4a677qpOmzVrFj179uRvf/sbf/zjxsEDTz31FPPmzavxWvfeey8VFRU8+eST1fmvu+46Jk+eTPv27avzjRw5kgcffJA1a9bw1ltvsWjRIgYNGlSE2hWXg4qZWRZJPP7440ybNo299tqLvn37MnbsWLp27cqUKVP45S9/Sa9evejTpw/33Xcfu+yyS97XvuCCC1i5ciVHHnkkAwYMqB4M0LdvX0466ST69OnD8OHDue2225rcyC/whJKF4dFfZgWzYMEC9t1334YuRouW6zfId0JJt1TMzKxgHFTMzKxgHFTMzKxgHFTMzKxgHFTMzKxgHFTMzKxgHFTMzLJcffXV9O3bl379+jFgwABefPFFAKZMmcLAgQPp378/ffr04c4772zgkm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wEXJnRWd+VZL2RsrRz/1WSGZGthfGQYrNmSFIJsD69lTWEZAVItxys6NynYtY87Q48LGkbkoEG32ng8lgL4ZaKmZkVjPtUzMysYBxUzMysYBxUzMysYBxUzMysYBxUzMysYBxUzMysYP4/WliYkYCWzacAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "series_small = [cct_small, ss1_small]\n",
    "\n",
    "fig_small = plot_side_by_side_hist(series_small, names, num_bins=20, num_x_ticks=6, y_logscale=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig_small.savefig('/home/marmot/camtrap/mnt/intermediate/dataset_paper/bbox_small_dist.svg', \n",
    "            format='svg', bbox_inches='tight')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### CCT small boxes\n",
    "There are no *tiny* boxes in CCT like the distant animals in SS."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████| 48103/48103 [00:00<00:00, 1328915.48it/s]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "area_threshold_pixels = 400\n",
    "small_boxes = []\n",
    "\n",
    "for a in tqdm(cct_annotations):\n",
    "    _, _, w, h = a['bbox']\n",
    "    area = w * h\n",
    "    if area < area_threshold_pixels:\n",
    "        small_boxes.append(a)\n",
    "len(small_boxes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "62399.56"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.02 * 3119978 # 2% of average size of images in CCT-20 - still quite large"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "249.79791832599406"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "math.sqrt(62399)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
